<template>
	<view class="warp">
		<view class="bg-purple demo-layout" v-for="(item,index) in setmealList" :key="index">
			<u--image :src="'https://health-wanglijie.oss-cn-hangzhou.aliyuncs.com/uni_img/'+item.img" 
			mode="widthFix" height="180rpx" width="240rpx" 
			style="position: relative;top: -40rpx;left: 30rpx;"
			radius="30rpx"></u--image>
			<view class="content">
				<view class="content2">
					<u--text style="width: 320rpx" :bold="true"
					:text="item.name" :lines="2" wordWrap="anywhere;"></u--text>
					<u--text :text="item.remark" style="width: 360rpx;"
					:lines="3" wordWrap="anywhere;"></u--text>
				</view>
				<view class="content1">
					<u--text :text="item.sex == '0' ? '性别不限' : item.sex == '1' ? '男':'女'" 
					style="width: 180rpx;" color="#ffaa00"></u--text>
					<u--text :text="item.age" color="#ffaa00"></u--text>
				</view>
				<view style="position: absolute;top: 215rpx;left: 235rpx">
					<u-button type="primary" text="查看详情" size="normal" style="width: 120rpx;"
					@click="findSetmealById(item.id)"></u-button>
				</view>
				
			</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		props:{
			setmealList:{
				type:Array,
				default:()=>[]
			}
		},
		methods: {
			findSetmealById(id){
				uni.navigateTo({
					url:"/pages/setmealDetail/setmealDetail?id="+id
				})
			}
		},
		onLoad() {
			console.log(setmealList)
		}
	}
</script>

<style scoped>
	.content{
		position: relative;
		display: flex;
		flex-direction: column;
		position: relative;
		left: 280rpx;
		top: -220rpx
	}
	.content1{
		position: absolute;
		display: flex;
		flex-direction: row;
		top: 200rpx
	}
	.content2{
		position: absolute;
		display: flex;
		flex-direction: column;
	}
	.warp{
		padding: 30rpx;
	}
	.demo-layout {
		/* width: 300rpx; */
		display: flex;
		flex-direction: column;
		height: 360rpx;
		margin-top: 50rpx;
		border-radius: 18rpx;
		justify-content: center;
		
	}
		
	.bg-purple {
		background: #d3dce6;
	}
</style>
